﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Utilities.QuickSql;
using MySql.Data;

namespace Deviseur_Cs2i_Car
{
    class CONTENANCE
    {
       
        int NumContenance;
        string LibelleContenance;

        public CONTENANCE()
        {
        }
        public CONTENANCE(string LibelleContenance)
        {
            this.LibelleContenance = LibelleContenance;
        }
        public CONTENANCE(int NumContenance, string LibelleContenance)
        {
            this.NumContenance = NumContenance;
            this.LibelleContenance = LibelleContenance;
        }
        public CONTENANCE(int NumContenance)
        {
            this.NumContenance = NumContenance;
        }
        public int get_NumContenance()
        {
            return this.NumContenance;
        }
        public string get_LibelleContenance()
        {
            return this.LibelleContenance;
        }
        public void set_NumContenance(int NumContenance)
        {
            this.NumContenance = NumContenance;
        }
        public void set_LibelleContenance(string LibelleContenance)
        {
            this.LibelleContenance = LibelleContenance;
        }
        public void affiche_Contenance()
        {
            Console.WriteLine("Num Contenance : ", this.NumContenance);
            Console.WriteLine("Libelle Contenance : ", this.LibelleContenance);
        }
        public void new_Contenance()
        {
            Program.Db.Execute("INSERT INTO CONTENANCE (LibelleContenance) VALUES ('" + this.LibelleContenance + "')");
        }
        public void modify_Contenance()
        {
            Program.Db.Execute("UPDATE CONTENANCE SET LibelleContenance = '" + this.LibelleContenance + "' WHERE NumContenance = " + this.NumContenance + "");
        }
        public void delete_Contenance(int NumContenance)
        {
            Program.Db.Execute("DELETE FROM CONTENANCE WHERE NumContenance = " + NumContenance + "");
        }
        

    }
}

